package com.group1.realtime.util;

import com.group1.realtime.common.Constant;

public class SQLUtil {
    public static String getKafkaSourceDDL(String topic, String groupId) {
        return "with(" +
                "'connector' = 'kafka', " +
                "'properties.bootstrap.servers' = '" + Constant.KAFKA_BROKERS + "', " +
                "'properties.group.id' = '" + groupId + "', " +
                "'topic' = '" + topic + "', " +
                "'format' = 'json'" +
                ")";
    }

    public static String getKafkaSinkDDL(String topic) {
        return "with(" +
                "'connector' = 'kafka', " +
                "'properties.bootstrap.servers' = '" + Constant.KAFKA_BROKERS + "', " +
                "'topic' = '" + topic + "', " +
                "'format' = 'json'" +
                ")";
    }

    public static String getUpsertKafkaSinkDDL(String topic) {
        return "with(" +
                "'connector' = 'upsert-kafka', " +
                "'properties.bootstrap.servers' = '" + Constant.KAFKA_BROKERS + "', " +
                "'topic' = '" + topic + "', " +
                "'key.format' = 'json', " +
                "'value.format' = 'json' " +
                ")";
    }
}


